<?php include_once './application/views/sys_admin/common/header.php';  ?>
<!-- admin_main -->
<div class=" definewidth m20">
	<form  method="post" id="form" name="form">
		<input name="id" type=hidden value="<?php echo $id;?>" />
		<input name="adminname" type=hidden value="<?php echo $adminname;?>" />
		
		<table class="table table-bordered table-hover m10">
			 <tr>
		        <td class="tableleft">用户名</td>
		        <td><?php echo $adminname;?></td>
		    </tr>
		    <tr>
		        <td class="tableleft">管理员密码</td>
		        <td><input type="password" name="password" id="password" size="60"  value="" /></td>
		    </tr>
		    <tr>
		        <td class="tableleft">管理员备注</td>
		        <td><input type="text" name="remark" id="remark" size="60"  value="<?php echo $remark;?>" /></td>
		    </tr>
		    <tr>
		        <td class="tableleft">验证码</td>
		        <td>
		        <input id="captcha" name="captcha" type="text" class="form-control x164 in">
				<img src="/yanzheng/index/" id="imgCode" onclick="changeImage();" alt="点击更换" title="点击更换"/>
				</td>
		    </tr>
		    <tr>
		        <td class="tableleft"></td>
		        <td><button type="button" class="btn btn-success"  onclick="toSubmit();" >提交</button></td>
		    </tr>
		</table>
		
	</form>
</div>

<script>
function changeImage() {
	document.getElementById("imgCode").src = "/yanzheng/index/?" + Math.random();
}
function toSubmit(){
	var options = {
		url : '/sys_admin/welcome/passwd_edit/',
		dataType: "json",
		type:"post",
		success : function(ret) {
			if(ret.msg != ''){
				alert(ret.msg);
				changeImage();
			}
			else {
				alert('更新成功,请重新登录');
				parent.location=ret.url;
			}
		}
	};
	$("#form").ajaxSubmit(options);
	return false;
}
</script>